package com.zsw.example03;

public class Student extends Person{
    //学号
    public int no;
    //英语成绩
    public double scoreEn;
    //数学成绩
    public double scoreMath;
    //语文成绩
    public double scoreCh;
    //平均分
    public double aver;
    //最高分
    public double max;
    //最低分
    public double min;


    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }

    public double getAver() {
        return aver;
    }

    public void setAver(double aver) {
        this.aver = aver;
    }

    public double getMax() {
        return max;
    }

    public void setMax(double max) {
        this.max = max;
    }

    public double getMin() {
        return min;
    }

    public void setMin(double min) {
        this.min = min;
    }
    public Student(){
        super();
    }
    //平均分
    public double aver(){
        double a1 = (scoreEn+scoreMath+scoreCh)/3;
        return a1;
    }
    //最高分
    public double max(){
        double a2 =Math.max(Math.max(scoreMath,scoreCh),scoreEn);
        return a2;
    }
    //最低分
    public double min(){
        double a3 =Math.min(Math.min(scoreCh,scoreEn),scoreMath);
        return a3;
    }

    @Override
    public String toString() {
        Student student = new Student();
        student.max();
        student.aver();
        student.min();
        return "Student{" +
                "no=" + no +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                ", aver=" + aver() +
                ", max=" + max() +
                ", min=" + min() +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}

